package com.relytosoft.mizar.media.common.entity.pojo.request.btdl.common;

import cn.hutool.core.date.LocalDateTimeUtil;
import com.relytosoft.mizar.media.common.entity.algo.AyControlFace;
import com.relytosoft.mizar.media.common.entity.pojo.base.BaseAlgoControlReq;
import com.relytosoft.mizar.media.common.entity.pojo.dto.AyControlAlarmDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author wss
 * @version 1.0
 * @date 2022/5/20 17:01
 */
@ApiModel("btdl人脸布控对象")
public class BtdlFaceControlReq extends BaseAlgoControlReq {

    private static final String ALARM_DTO_MSG = "人脸布控告警";


    @ApiModelProperty("布控id")
    private String executeControlId;

    @ApiModelProperty("设备id")
    private String deviceId;

    @ApiModelProperty("任务id")
    private String taskId;

    @ApiModelProperty("人员id")
    private String personId;

    @ApiModelProperty("快照id")
    private String snapRecordId;

    @ApiModelProperty("评分")
    private Double score;

    @ApiModelProperty("组id")
    private String groupId;

    @ApiModelProperty("记录时间")
    private Long recordTime;

    @ApiModelProperty("人脸")
    private AyControlFace gAFace;

    /**
     * 构建布控报警对象
     *
     * @param btdlFaceControlReq
     * @return
     */
    public static AyControlAlarmDto buildControlAlarm(BtdlFaceControlReq btdlFaceControlReq) {
        AyControlAlarmDto ayControlAlarmDto = new AyControlAlarmDto();
        ayControlAlarmDto.setTaskId(btdlFaceControlReq.getExecuteControlId());
        ayControlAlarmDto.setAlarmImg(btdlFaceControlReq.getgAFace().getImage());
        ayControlAlarmDto.setCameraId(btdlFaceControlReq.getDeviceId());
        ayControlAlarmDto.setAlarmTime(LocalDateTimeUtil.of(btdlFaceControlReq.getgAFace().getMarkTime()));
        ayControlAlarmDto.setRemark(ALARM_DTO_MSG);
        return ayControlAlarmDto;
    }

    public String getExecuteControlId() {
        return executeControlId;
    }

    public void setExecuteControlId(String executeControlId) {
        this.executeControlId = executeControlId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getSnapRecordId() {
        return snapRecordId;
    }

    public void setSnapRecordId(String snapRecordId) {
        this.snapRecordId = snapRecordId;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    public Long getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(Long recordTime) {
        this.recordTime = recordTime;
    }

    public AyControlFace getgAFace() {
        return gAFace;
    }

    public void setgAFace(AyControlFace gAFace) {
        this.gAFace = gAFace;
    }

    public String getPersonId() {
        return personId;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    @Override
    public String toString() {
        return "BtdlFaceControlReq{" +
                "executeControlId='" + executeControlId + '\'' +
                ", deviceId='" + deviceId + '\'' +
                ", taskId='" + taskId + '\'' +
                ", personId='" + personId + '\'' +
                ", snapRecordId='" + snapRecordId + '\'' +
                ", score=" + score +
                ", groupId='" + groupId + '\'' +
                ", recordTime=" + recordTime +
                ", gAFace=" + gAFace +
                '}';
    }
}
